package com.xqboss.apps.domain.sys;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xqboss.apps.domain.BaseTable;
import com.xqboss.apps.enums.sys.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 系统弹窗表
 */
@Data
@ApiModel
public class SysPopup extends BaseTable {

    @ApiModelProperty("弹窗ID")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "弹窗标题", required = true)
    @NotEmpty(message = "请输入弹窗标题")
    private String title;

    @ApiModelProperty(value = "弹窗图片", required = true)
    @NotEmpty(message = "请输入弹窗图片")
    private String img;

    @ApiModelProperty(value = "弹窗位置",required = true)
    @NotNull(message = "请选择弹窗位置")
    private PopupPositionEnum position;

    @ApiModelProperty(value = "弹窗类型", required = true)
    @NotNull(message = "请选择弹窗类型")
    private PopupTypeEnum type;

    @ApiModelProperty("上架时间")
    private LocalDateTime saleableTime;

    @ApiModelProperty("是否上架")
    @Column(updatable = false, insertable = false)
    private Boolean saleable;

    @ApiModelProperty("下架时间")
    private LocalDateTime unsaleableTime;

    @TableField(exist = false)
    @ApiModelProperty("富媒体内容")
    private String content;

    @ApiModelProperty("oss存储路径")
    private String ossPath;

    @ApiModelProperty(value = "跳转类型",required = true)
    @NotNull(message = "请选择跳转类型")
    private PopupJumpEnum jumpType;

    @ApiModelProperty("跳转内容")
    private String jumpContent;

    @ApiModelProperty("注册开始时间筛选")
    private LocalDateTime registerTimeStart;

    @ApiModelProperty("注册截止时间筛选")
    private LocalDateTime registerTimeEnd;

    @ApiModelProperty(value = "弹窗次数",required = true)
    @NotNull(message = "请选择弹窗次数")
    private PopupShowTypeEnum showType;

    @ApiModelProperty("创建人")
    @JsonIgnore
    @Column(updatable = false)
    private Long createUserId;

    @ApiModelProperty("创建人姓名")
    @JsonIgnore
    @Column(updatable = false)
    private String createUserName;

}
